<%inherit file="/base.html"/>

<%def name="extra_css()">
	<link rel="stylesheet" type="text/css" href="${url('/css/pubservices.css')}"/>
</%def>

<%def name="main_heading()">${c.main_heading}</%def>

<%def name="toolbar()">${h.select_service(c.service)}</%def>

<%def name="content()">
	<form style="clear:both;">
		${_('from')}:
		${c.begin_year_select}
		${c.begin_month_select}
		${_('to')}:
		${c.end_year_select}
		${c.end_month_select}
	</form>
	<table class="data-table analysis">
		<thead>
			<tr>
				<th rowspan="${len(c.thead)}">${_('District')}</th>
				% for cell in c.thead[0]:
				<% caption, colspan = cell %>
				<th colspan="${colspan}">${caption}</th>
				% endfor
			</tr>
			% for row in c.thead[1:]:
			<tr>
				% for cell in row:
				<% caption, colspan = cell %>
				<th colspan="${colspan}">${caption}</th>
				% endfor
			</tr>
			% endfor
		</thead>
		<tbody>
			% for record in c.records:
			<tr>
				<td><a href="${url.current(action='total', id=record.district_id, analytics=None)}">${record.colloquial}</a></td>
				% for field in c.row(record):
				<td class="numeric">${field}</td>
				% endfor
			</tr>
			% endfor
			% if c.records:
			<tr class="weighty-record">
				<td>${_('Total')}</td>
				% for field in c.row(c.total):
				<td class="numeric">${field}</td>
				% endfor
			</tr>
			% endif
		</tbody>
	</table>
</%def>